package io.gitee.hchaojie.day03;

public class Boss {
    private String name = "王老板";
    private int age = 20;

    // 方法的多态
    public void pay(Employee e) {
        // 可以访问同样一个包里面的protected变量
        System.out.println(e.department);

        System.out.println("给员工发工资");
    }

//    @Override
//    public String toString() {
//        return (name + "" + age);
//    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Boss{");
        sb.append("name='").append(name).append('\'');
        sb.append(", age=").append(age);
        sb.append('}');
        return sb.toString();
    }
}
